﻿<!DOCTYPE HTML>
<html>
<head th:include="fragments/_header :: _head('用户周消费汇总')">
</head>
<body>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray">
		<span class="l">
		</span>
		<span class="r">共有数据：<strong th:text="${page.total}">0</strong> 条</span>
	</div>
	<div class="text-c mt-20">
		<form action="/statistics/cost/week" id="searchForm">
			<input type="hidden" name="page" id="page" th:value="${page.current}">
			<input type="text" id="dateStr" name="dateStr" th:value="${dateStr}" onclick="WdatePicker({specialDays:[1],dateFmt:'yyyy/MM/dd',disabledDays:[0,2,3,4,5,6]})"/>
			<button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</form>
	</div>
	<div class="dataTables_wrapper no-footer  mt-20">
		<table class="table table-border table-bordered table-bg">
			<thead>
			<tr>
				<th scope="col" colspan="6">用户周消费汇总列表</th>
			</tr>
			<tr class="text-c">
				<th width="50">用户ID</th>
				<th width="150">用户名</th>
				<th width="120">消费</th>
				<th width="180">周期</th>
				<th width="120">状态</th>
				<th width="100">操作</th>
			</tr>
			</thead>
			<tbody>
			<tr class="text-c"  th:each="week:${page.records}">
				<td th:text="${week.userId}">history</td>
				<td th:text="${week.username}">history</td>
				<td th:text="${week.cost}">history</td>
				<td  th:text="${week.periodOfTime}">2014-6-11 11:11:42</td>
				<td class="td-status" th:if="${week.status eq 1}"><span class="label label-success radius">已结算</span></td>
				<td class="td-status" th:if="${week.status ne 1}"><span class="label radius">待结算</span></td>
				<td class="td-manage">
					<a style="text-decoration:none" class="btn btn-danger radius" th:aid="${week.id}" href="javascript:;" th:if="${week.status eq 0}" onclick="stop(this)"  title="已结算">已结算</a>
				</td>
			</tr>
			</tbody>
		</table>
		<div th:replace="fragments/_page :: pageBar(${page})"></div>
		<div th:replace="fragments/_page :: pagination(${page})"></div>
	</div>
</div>
<div th:include="fragments/_footer :: _footer"></div>
<script th:replace="fragments/_page :: pageScript"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script>
	/*管理员-启用*/
	function stop(obj,id){
		var id = $(obj).attr("aid");
		layer.confirm('确认已经结算了吗？', function (index) {
			$.post("/statistics/cost/week/over", {id: id}, function (result) {
				if (result.success) {
					window.location.reload();
				} else {
					layer.msg(result.msg, {icon: 2, time: 1000});
				}
			});
		});
	}
</script>
</body>
</html>